set(MODULE_NAME "string_split")

set(MODULE_SRCS
    string_split.c
)

include_directories(${PROJECT_SOURCE_DIR}/include)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/output)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/bin)

add_library(${MODULE_NAME}_static STATIC ${MODULE_SRCS})
add_library(${MODULE_NAME} SHARED ${MODULE_SRCS})

set_target_properties(${MODULE_NAME}_static PROPERTIES OUTPUT_NAME "string_split")
set_target_properties(${MODULE_NAME} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(${MODULE_NAME}_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

set_target_properties(${MODULE_NAME} PROPERTIES VERSION 1.0 SOVERSION 1)

file(COPY ${PROJECT_SOURCE_DIR}/include/string_split.h DESTINATION ${EXECUTABLE_OUTPUT_PATH}/include/string_split.h)